package utils;

import com.google.i18n.phonenumbers.NumberParseException;
import com.google.i18n.phonenumbers.PhoneNumberUtil;
import com.google.i18n.phonenumbers.Phonenumber;

/**
 * @Author: huangkunming
 * @Date: 2024/4/3 11:50
 * @Description:
 */
public class PhoneNumerValidUtil {

    public static void main(String[] args) {
        System.out.println("26 Riverside Lane Seville".length());
    }

    private static boolean checkPhone(String swissNumberStr, String region) {
        PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
        try {
            Phonenumber.PhoneNumber swissNumberProto = phoneUtil.parse(swissNumberStr, region);
            boolean isValid = phoneUtil.isValidNumber(swissNumberProto);
            return isValid;
        } catch (NumberParseException e) {
            System.err.println("NumberParseException was thrown: " + e.toString());
        }
        return false;
    }
}
